package com.corpgovernment.common.utils.DataPermissions;

import com.corpgovernment.common.base.ResourceInfo;
import com.corpgovernment.common.config.CommonApplicationContext;
import com.corpgovernment.common.dataloader.CommonOrganizationDataloader;
import com.corpgovernment.common.dto.RoleResourceDTO;

/**
 * @author Ks.Xing
 * <p>
 * description:
 * create: 2023-05-30 15:07
 */
public class DataPermissionsContext {

    public static RoleResourceDTO getUserDataPermissions() {
        return getUserDataPermissionsInfo().getRoleDataPermissions();
    }

    public static ResourceInfo getRoleAllDataPermissions() {
        return getUserDataPermissionsInfo().getRoleAllDataPermissions();
    }

    private static DataPermissionsConfig getUserDataPermissionsInfo(){
        DataPermissionsConfig dataPermissionsConfig = CommonApplicationContext.getApplicationContext().getBean("dataPermissionsConfig", DataPermissionsConfig.class);
        return dataPermissionsConfig;
    }
}
